const mongoose = require('mongoose')
const {formatDate} = require('../../utils')
const HttpSchema = new mongoose.Schema({
    url: { type: String, required: true, trim: true },
    userId: {type: String, required: true},
    username: {type: String, required: true},
    mark: { type: String, required: true, trim: true},
    remarks: { type: String, trim: true},
    ctime: { type: String, required: true, default: formatDate() },
    stopTime: { type: String },
    lastTime: { type: String },
    phone: { type: String },
    status: {type: Number, required: true, min: 1, max: 2, default: 1}, //1开启监控 2停止监控
    urlStatus: { type: Number, required: true, min: 1, max: 2, default: 2}, //1正常 2离线
    notifyStatus: {type: Number, required: true, min: 1, max: 2, default: 2} //1开启 2关闭
}) 

const Http = mongoose.model('https', HttpSchema)

module.exports = Http